{% extends 'sys_templates/public/base.html' %}
{% block head %}
    <style>p {
        text-indent: 35px
    }</style>
{% endblock %}
{% block content %}
    <fieldset class="layui-elem-field layui-field-title site-title">
        <legend><a name="default">{{ title }}</a></legend>
    </fieldset>
    <blockquote class="layui-elem-quote">
        此功能为激活TLCMS系统!<br>
        小提示：<br>
        <p>1、本系统为授权版，未激活将不可使用</p>
        <p>2、激活方式需购买授权相关密钥!</p>
        <p>3、填写相关信息,即可使用系统</p>
        <p>4、激活系统请联系开发者QQ: 1368419640</p>
    </blockquote>
    <form class="layui-form">
        {% for foo in form %}
            <div class="layui-form-item">
                <label class="layui-form-label">{{ foo.label }}</label>
                <div class="layui-input-block">
                    {{ foo }}
                </div>
            </div>
        {% endfor %}
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <a class="layui-btn" href="javascript:;" onclick="submit_post()">提交验证</a>
        </div>
    </form>
{% endblock %}
{% block footer_js %}
<script>
function submit_post() {
    var data = $("form").serializeArray();
    $.ajax({
        type: 'POST',
        data: data,
        dataType: "json",
        success: function (data) {
            if (data.status === 0) {
                layer.msg('验证成功!欢迎使用', {icon: 1, time: 2000});
            } else {
                layer.msg('验证失败: ' + data.message, {icon: 2, time: 3000});
            }
        }, error: function (data) {
            layer.msg('验证失败!', {icon: 2, time: 2000});
        }
    });
    return false;
}
</script>
{% endblock %}